<template>
  <h1>El-表单组件</h1>
  <el-form style="width: 400px;margin: 0 auto;"label-width="80px">
    <el-form-item label="用户名">
      <el-input v-model="name" placeholder="请输入用户名"></el-input>
    </el-form-item>

    <el-form-item label="密码">
      <el-input v-model="password" placeholder="请输入密码" show-password></el-input>
    </el-form-item>

    <el-form-item label="性别">
      <el-radio-group v-model="sex">
        <el-radio-button label="男">男</el-radio-button>
        <el-radio-button label="女">女</el-radio-button>
      </el-radio-group>
    </el-form-item>

    <el-form-item label="所在地">
      <el-select v-model="city" placeholder="请选择城市">
        <el-option label="北京" value="北京"></el-option>
        <el-option label="长春" value="长春"></el-option>
        <el-option label="武汉" value="武汉"></el-option>
        <el-option label="郑州" value="郑州"></el-option>
      </el-select>
    </el-form-item>

    <el-form-item label="管理员">
      <el-switch v-model="isAdmin"></el-switch>
    </el-form-item>

    <el-button type="success" @click="submit" style="width: 100px">提交</el-button>
  </el-form>
</template>

<script setup>
import  {ref} from "vue"
const name = ref('');
const password = ref('');
const sex = ref('');
const city = ref('');
const isAdmin = ref(false);
function submit(){
  console.log(name.value);
  console.log(password.value);
  console.log(sex.value);
  console.log(city.value);
  console.log(isAdmin.value);
}
</script>


<style scoped>

</style>